from config.model_config import get_base_open_ai, xin_qwen_model

client = get_base_open_ai()

def chat_completions4(query):
    resp = client.chat.completions.create(
            model=xin_qwen_model,
            messages=[
                {"role": "system", "content": "You are a helpful assistant."},
                {"role": "user", "content": query}
            ],
            stream=True
    )
    print(resp)
    for chunk in resp:
        print(chunk.choices[0].delta.content, end="", flush=True)

if __name__ == '__main__':
    chat_completions4("蒸一个包子要5分钟, 蒸5个要多少分钟")
